package com.ruoyi.organization.service.impl;

import java.util.Collections;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.organization.mapper.BizGridMappingMapper;
import com.ruoyi.organization.domain.BizGridMapping;
import com.ruoyi.organization.service.IBizGridMappingService;

/**
 * 网格关联Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-18
 */
@Service
public class BizGridMappingServiceImpl implements IBizGridMappingService 
{
    @Autowired
    private BizGridMappingMapper bizGridMappingMapper;

    /**
     * 查询网格关联
     * 
     * @param gridMappingId 网格关联主键
     * @return 网格关联
     */
    @Override
    public BizGridMapping selectBizGridMappingByGridMappingId(Long gridMappingId)
    {
        return bizGridMappingMapper.selectBizGridMappingByGridMappingId(gridMappingId);
    }

    /**
     * 查询网格关联列表
     * 
     * @param bizGridMapping 网格关联
     * @return 网格关联
     */
    @Override
    public List<BizGridMapping> selectBizGridMappingList(BizGridMapping bizGridMapping)
    {
        return bizGridMappingMapper.selectBizGridMappingList(bizGridMapping);
    }

    /**
     * 新增网格关联
     * 
     * @param bizGridMapping 网格关联
     * @return 结果
     */
    @Override
    public int insertBizGridMapping(BizGridMapping bizGridMapping)
    {
        bizGridMapping.setCreateTime(DateUtils.getNowDate());
        return bizGridMappingMapper.insertBizGridMapping(bizGridMapping);
    }

    /**
     * 修改网格关联
     * 
     * @param bizGridMapping 网格关联
     * @return 结果
     */
    @Override
    public int updateBizGridMapping(BizGridMapping bizGridMapping)
    {
        bizGridMapping.setUpdateTime(DateUtils.getNowDate());
        return bizGridMappingMapper.updateBizGridMapping(bizGridMapping);
    }

    /**
     * 批量删除网格关联
     * 
     * @param gridMappingIds 需要删除的网格关联主键
     * @return 结果
     */
    @Override
    public int deleteBizGridMappingByGridMappingIds(Long[] gridMappingIds)
    {
        return bizGridMappingMapper.deleteBizGridMappingByGridMappingIds(gridMappingIds);
    }

    /**
     * 删除网格关联信息
     * 
     * @param gridMappingId 网格关联主键
     * @return 结果
     */
    @Override
    public int deleteBizGridMappingByGridMappingId(Long gridMappingId)
    {
        return bizGridMappingMapper.deleteBizGridMappingByGridMappingId(gridMappingId);
    }

    /**
     * 删除网格
     *
     * @param peopleId
     */
    @Override
    public int deleteBizGridMappingByPeopleId(long peopleId) {
        return bizGridMappingMapper.deleteBizGridMappingByPeopleId(peopleId);

    }

}
